Skip to content

Conversation

@tjvantoll
Copy link
Member

...8975 - Buttonset: refresh method causes JS error after adding new radio buttons

See http://bugs.jqueryui.com/ticket/8975.

…d #8975 - Buttonset: refresh method causes JS error after adding new radio buttons
@scottgonzalez
Copy link
Member

This fix seems wrong. An individual button instance shouldn't be instantiating other buttons. If you reverse the order of refersh/create in buttonset's refresh() doe that fix it? If so, we'll want to stop chaining so that we don't call refresh() on the newly created buttons.

@tjvantoll
Copy link
Member Author

Reversing the order in buttonset's refresh does fix this, but it breaks the fix for #5946. button's refresh assumes that all buttons in the group are button widgets, so if one isn't (in the case of #5946 one isn't visible) it'll crash on button("widget") the same way.

I'll have to think about this one a bit more.

@tjvantoll
Copy link
Member Author

I cannot come up with a reasonable fix for this that doesn't involve altering button's refresh. Doing this.element.find('input[type="radio"]').not(':ui-button').button(); at the beginning of buttonset's refresh works, but feels dirty.

Currently if you call refresh on a input[type="radio"] button it will alter all radio buttons in its group. Would it be unreasonable to change it to act only on the current radio button? Is there any use case for using radio inputs with button instead of buttonset?

@tjvantoll
Copy link
Member Author

Closing this for now because a different approach needs to be taken.

@tjvantoll tjvantoll closed this Mar 8, 2013
scottgonzalez added a commit that referenced this pull request Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants